/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package de.aeo.bll;
import java.util.ArrayList;;

/**
 * @author Frederic Branczyk & Robert Piwonski
 */
public class Student implements Comparable<Student> {
    
    private String firstname;
    private String lastname;
    private String cClass;
    private Subject[] subjectList;
    private Course[] courseList;
    private int state;
    private ArrayList<ArrayList<Course>> coursesAtLayer;
    private ArrayList<ArrayList<Course>> altAtLayer;
    
    public Student(String firstname, String lastname, String cClass) {
        this.firstname = firstname;
        this.lastname = lastname;
        this.cClass = cClass;
        this.subjectList = new Subject[5];
        this.courseList = new Course[4];
        this.state = 2;
    }
    
    public Student(String firstname, String lastname, String cClass, Subject[] subjectList) {
        this.firstname = firstname;
        this.lastname = lastname;
        this.cClass = cClass;
        this.subjectList = subjectList;
        this.courseList = new Course[4];
        this.state = 2;
    }

    public Subject[] getSubjectList() {
        return subjectList;
    }

    public void setSubjectList(Subject[] classesList) {
        this.subjectList = classesList;
    }
    
    public Course[] getCourseList() {
        return this.courseList;
    }

    public void setCourseList(Course[] courseList) {
        this.courseList = courseList;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getcClass() {
        return cClass;
    }

    public void setcClass(String cClass) {
        this.cClass = cClass;
    }
        public ArrayList<ArrayList<Course>> getAltAtLayer() {
        return altAtLayer;
    }

    public void setAltAtLayer(ArrayList<ArrayList<Course>> altAtLayer) {
        this.altAtLayer = altAtLayer;
    }

    public ArrayList<ArrayList<Course>> getCoursesAtLayer() {
        return coursesAtLayer;
    }

    public void setCoursesAtLayer(ArrayList<ArrayList<Course>> coursesAtLayer) {
        this.coursesAtLayer = coursesAtLayer;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }
    
    @Override
    public String toString() {
        if(this!=null) 
            return this.getFirstname()+" "+this.getLastname()+" - "+this.getcClass();
        else 
            return "null";
        
    }

    @Override
    public int compareTo(Student o) {
        if (o.getLastname() == null && this.getLastname() == null) {
          return 0;
        }
        if (this.getLastname() == null) {
          return 1;
        }
        if (o.getLastname()== null) {
          return -1;
        }
        return this.getLastname().compareTo(o.getLastname());
    }
    
}
